package org.epidroid.epidroid.androsoul.engine.service;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;

import org.epidroid.epidroid.androsoul.engine.communication.Connection;
import org.epidroid.epidroid.androsoul.engine.contacts.ContactGroup;
import org.epidroid.epidroid.androsoul.engine.contacts.NetsoulContact;
import org.epidroid.epidroid.androsoul.engine.conversation.OpenedConversations;

/**
 * @author conrat_a Interface between the user interface and the androsoul
 *         service
 */
public interface IAndroSoulService {

	public void addListener(IAndroSoulServiceListener listener);

	public void removeListener(IAndroSoulServiceListener listener);

	/*
	 * States
	 */

	public Connection.State getConnectionState();

	public Boolean connect(String login, String pass);

	public void logout();

	public void setMyState(String state);

	public NetsoulContact getMySelf();

	public void setMyComment(String comment);

	public void setMyLocation(String location);

	public String getMyLocation();

	/*
	 * Contacts
	 */

	public NetsoulContact getContactFromName(String name);

	public void contactsLoad(FileInputStream fis);

	public void contactsSave(FileOutputStream fos);

	public List<ContactGroup> getGroupsList();

	public NetsoulContact addContact(String name, ContactGroup group);

	public NetsoulContact addContact(String name);

	public void addContacts(List<String> contacts, ContactGroup group);

	public void deleteContact(NetsoulContact contact, ContactGroup group);

	public void deleteGroup(ContactGroup group);

	public void clearContacts();

	public ContactGroup addGroup(String name);

	public ContactGroup getGroupFromName(String name);

	public ArrayList<ContactGroup> getContactGroups(NetsoulContact contact);

	public Boolean renameGroup(ContactGroup group, String name);
	
	public void sendListUser(String name);

	/*
	 * Conversations
	 */
	public void openConversation(NetsoulContact contact);

	public void closeConversation(NetsoulContact contact);

	public OpenedConversations getOpenedConversations();

	public void sendContactWizz(NetsoulContact contact);

	public void sendContactMessage(NetsoulContact contact, String content);

	public void sendContactIsTyping(NetsoulContact contact);

	public void sendContactStopTyping(NetsoulContact contact);

	/*
	 * Preferences
	 */
	public void enableWizz(boolean value);

	public void enableNotifContactLogin(boolean value);

	public void enableNotifContactLogoff(boolean value);

	public void enableNotifMessageReceived(boolean value);

	/*
	 * Other
	 */
	public void enableNotifs(boolean enable);

	public void ping();

}
